################################################################################
#  Licensed to the Apache Software Foundation (ASF) under one
#  or more contributor license agreements.  See the NOTICE file
#  distributed with this work for additional information
#  regarding copyright ownership.  The ASF licenses this file
#  to you under the Apache License, Version 2.0 (the
#  "License"); you may not use this file except in compliance
#  with the License.  You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
# limitations under the License.
################################################################################


#==============================================================================
# Common
#==============================================================================

# The external address of the host on which the JobManager runs and can be
# reached by the TaskManagers and any clients which want to connect. This setting
# is only used in Standalone mode and may be overwritten on the JobManager side
# by specifying the --host <hostname> parameter of the bin/jobmanager.sh executable.
# In high availability mode, if you use the bin/start-cluster.sh script and setup
# the conf/masters file, this will be taken care of automatically. Yarn
# automatically configure the host name based on the hostname of the node where the
# JobManager runs.
###################################################################################
#                                                                                 #
#                             flin  on  yarn                                      #
#                                                                                 #
###################################################################################

env.pid.dir: /opt/edp/${service.serviceName}/data
env.log.dir: /opt/edp/${service.serviceName}/log
env.yarn.conf.dir: /opt/edp/${service.serviceName}/conf
env.hadoop.conf.dir: /opt/edp/${service.serviceName}/conf

<#if dependencies.ZOOKEEPER??>
    <#assign zookeeper=dependencies.ZOOKEEPER quorums=[]>
    <#list zookeeper.serviceRoles['ZOOKEEPER_SERVER'] as role>
        <#assign quorums += [role.hostname + ":" + zookeeper.conf["zookeeper.client.port"]]>
    </#list>
    <#assign quorum = quorums?join(",")>
</#if>
high-availability.zookeeper.quorum: ${quorum}
<#list confFiles['flink-conf.yaml']?keys as key>
    <#if key == "taskmanager.memory.managed.size" || key == "jobmanager.memory.process.size" || key == "taskmanager.memory.network.max" || key == "taskmanager.memory.process.size" || key == "jobmanager.memory.jvm-metaspace.size" || key == "taskmanager.memory.network.min" || key == "taskmanager.memory.jvm-metaspace.size">
${key}: ${confFiles['flink-conf.yaml'][key]}mb
    <#elseif key == "akka.ask.timeout">
${key}: ${confFiles['flink-conf.yaml'][key]}s
    <#else>
${key}: ${confFiles['flink-conf.yaml'][key]}
    </#if>
</#list>
